home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mm / ccmd / cmkey.cnf < prev    next >
Encoding:
Text File  |  1990-12-18  |  2.0 KB  |  70 lines

  1. _
  2. _ Copyright (c) 1986, 1990 by The Trustees of Columbia University in
  3. _ the City of New York.  Permission is granted to any individual or
  4. _ institution to use, copy, or redistribute this software so long as it
  5. _ is not sold for profit, provided this copyright notice is retained.
  6. _
  7. _ Author: Andrew Lowry
  8.  
  9. /* keyword parse errors */
  10.  
  11. fnerror(NM,`Does not match keyword')
  12. fnerror(AMB,`Ambiguous')
  13. fnerror(ABR,`Invalid abbreviation chain in keyword table')
  14.  
  15. /*
  16.  * KEYWRD structure specifies one entry in a keyword table.  KEYTAB
  17.  * structure describes a table of keywords.
  18.  */
  19.  
  20. #ifdef notdef
  21. /*
  22.  * we want to return "anything" as the value of a keyword,
  23.  * so we need to know what is the 'largest' type in a machine independent 
  24.  * way.   I can't figure out a way to do this at compile time, so we'll use a 
  25.  * generated include file.
  26.  */
  27.  
  28. #include "cmkeyval.h"        /* this defines the keyval type */
  29. #endif
  30.  
  31. #ifdef KEYVAL_TYPE
  32. typedef KEYVAL_TYPE keyval;
  33. #else
  34. typedef long keyval;
  35. #endif
  36.  
  37.  
  38. typedef struct KEYWRD {
  39.     char *    _kwkwd;    /* keyword string */
  40.     short    _kwflg;    /* flags (see below) */
  41.     keyval    _kwval;    /* arbitrary value, not used internally */
  42.             /*  except for abbreviations... see KEY_ABR */
  43.             /*  flag below */
  44. } keywrd;
  45.  
  46. typedef struct KEYTAB {
  47.     int    _ktcnt;    /* number of keywords in table */
  48.     keywrd * _ktwds;/* array of keyword entries */
  49.     int    _ktwid;    /* fixed column width for help */
  50. } keytab;
  51.  
  52. /* Valid flags in fdb */
  53. fnflag(EMO)        /* exact match only */
  54. fnflag(PTR)        /* return pointer to keywrd struct */
  55. fnflag(WID)        /* fixed width on help */
  56.  
  57. /* flags that can be present in a keyword entry */
  58.  
  59. fnflag(ABR)        /* keyword is an abbreviation for the */
  60.             /* keyword indexed by this entry's _kwval value */
  61.  
  62. fnflag(NOR)        /* Ignore this keyword (do not recognize */
  63.             /*  any prefix, or even an exact match) */
  64. #define KEY_IGN KEY_NOR
  65. fnflag(INV)        /* Invisible keyword (not shown with help) */
  66. fnflag(MAT)        /* This keyword matches current input */
  67.             /*  (used internally) */
  68.  
  69. pvtype(keyval)_        /* KEY returns a keyval. */
  70.